package com.c0nflict.server;

public class Rank {

	static public int getRankId(int elo) {
		return ((int)elo / 60);
	}
	
	static public String getRankImageSmall(int elo) {
		int id = getRankId(elo);
		
		if (id > 17) id = 17;
		
		return "images/rank/e" + id + "sm.gif";
	}
	
	static public String getRankName(int elo) {
		int rankId = getRankId(elo);
		String name = "";
		
		switch (rankId) {
		case 0:	 name = "Private"; break;
		case 1:	 name = "Private First Class"; break;
		case 2:	 name = "Corporal"; break;
		case 3:	 name = "Sergeant"; break;
		case 4:	 name = "Staff Segeant"; break;
		case 5:  name = "Sergeant First Class"; break;
		case 6:  name = "Master Sergeant"; break;
		case 7:  name = "Second Lieutenant"; break;
		case 8:  name = "First Lieutenant"; break;
		case 9:  name = "Captain"; break;
		case 10: name = "Major"; break;
		case 11: name = "Lieutenant Colonel"; break;
		case 12: name = "Colonel"; break;
		case 13: name = "Brigadier General"; break;
		case 14: name = "Major General"; break;
		case 15: name = "Lieutenant General"; break;
		case 16: name = "General"; break;
		case 17: name = "General of the Army"; break;
		default: name = "Unknown"; break;
		}
		
		return name;
	}

	static public String getShortRankName(int elo) {
		int rankId = getRankId(elo);
		String name = "";
		
		switch (rankId) {
		case 0:	 name = "PVT"; break;
		case 1:	 name = "PFC"; break;
		case 2:	 name = "CPL"; break;
		case 3:	 name = "SGT"; break;
		case 4:	 name = "SSG"; break;
		case 5:  name = "SFC"; break;
		case 6:  name = "MSG"; break;
		case 7:  name = "2LT"; break;
		case 8:  name = "1LT"; break;
		case 9:  name = "CPT"; break;
		case 10: name = "MAJ"; break;
		case 11: name = "LTC"; break;
		case 12: name = "COL"; break;
		case 13: name = "BG"; break;
		case 14: name = "MG"; break;
		case 15: name = "LTG"; break;
		case 16: name = "GEN"; break;
		case 17: name = "GOA"; break;
		default: name = ""; break;
		}
		
		return name;
	}
}
